package com.itstyle.webhook.utils;

import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.Buffer;

/**
 * @author : 765819328@qq.com
 * @version :
 * @date : Created in 2021/8/18 16:55
 * @description:
 * @modified By:
 */
public class HttpServletRequestReader {
    public static String readBodyFormRequest(HttpServletRequest request) {
        BufferedReader br = null;
        StringBuilder sb = new StringBuilder("");
        try {
            br = request.getReader();
            String str;
            while ((str = br.readLine()) != null) {
                sb.append(str);
            }
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return br.toString();

    }
}
